#include "util/timer.h"

NS_UTIL_BEGIN

void Timer::tic()
{
	t0 = clock();
}

double Timer::toc()
{
	t1 = clock();
	return (t1-t0)/CLOCKS_PER_SEC;
}

void sleep(double time)
{
	std::chrono::milliseconds dur(long(time*1000));
	std::this_thread::sleep_for(dur);
}

NS_UTIL_END